<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../js/vue.js"></script>
</head>

<body>
  <div id="app">
    <!-- v-model 双向绑定  -->
    <!-- <input type="text" v-model="message"> {{message}} -->

    <input type="text" :value="message" @input="inputVal">
    <h2>{{message}}</h2>

    <!-- 修饰符 -->
    <input type="text" v-model.lazy="name">
    <h2>{{name}}</h2>
    <input type="text" v-model.number="age">
    <h2>{{typeof age}}</h2>
    <input type="text" v-model.trim="names">
    <h2>{{names}}</h2>


  </div>
  <script>
    const vm = new Vue({
      el: '#app',
      data: {
        message: 'hello vue',
        name: 'kkk',
        age: '1',
        names: 'ss'
      },
      methods: {
        inputVal(e) {
          this.message = e.target.value
        }

      }
    })
  </script>
</body>

</html>